package p270jp.pxv.android.activity;

import android.app.Activity;
import android.content.ComponentCallbacks;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
import androidx.compose.p026ui.platform.C0536v1;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.google.android.material.appbar.MaterialToolbar;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import p014ae.AbstractActivityC0110k0;
import p014ae.C0124n;
import p014ae.C0134p;
import p014ae.C0149r7;
import p014ae.View$OnClickListenerC0054c;
import p036b5.LazyIterator;
import p041ba.C1048a;
import p045be.NestedCommentAdapter;
import p047bg.C1124a;
import p063c5.ObjFilter;
import p064c6.Preconditions;
import p131ef.NestedCommentMapper;
import p134ei.AnalyticsScreenName;
import p134ei.PixivAnalytics;
import p156ff.ChildComment;
import p156ff.NestedCommentItem;
import p156ff.SeeReplies;
import p165fo.Subscribe;
import p187gl.C3361j;
import p187gl.PixivRequest;
import p189gn.AbstractC3435a;
import p189gn.AbstractC3446l;
import p210hh.PixivAccountManager;
import p216hn.Lambda;
import p216hn.Reflection;
import p270jp.pxv.android.R;
import p270jp.pxv.android.comment.domain.model.CommentInputState;
import p270jp.pxv.android.comment.presentation.flux.CommentInputActionCreator;
import p270jp.pxv.android.comment.presentation.flux.CommentInputStore;
import p270jp.pxv.android.commonObjects.model.PixivComment;
import p270jp.pxv.android.event.ClickSeeRepliesEvent;
import p270jp.pxv.android.event.EventNone;
import p270jp.pxv.android.event.RemoveCommentConfirmedEvent;
import p270jp.pxv.android.event.RemoveCommentEvent;
import p270jp.pxv.android.event.ShowCommentInputEvent;
import p270jp.pxv.android.legacy.model.PixivIllust;
import p270jp.pxv.android.legacy.model.PixivNovel;
import p270jp.pxv.android.legacy.model.PixivWork;
import p270jp.pxv.android.model.ContentRecyclerViewState;
import p270jp.pxv.android.model.ResponseAttacher;
import p270jp.pxv.android.response.PixivResponse;
import p270jp.pxv.android.view.ContentRecyclerView;
import p285kf.CommentInputAction;
import p307l9.EdgeTreatment;
import p310lc.C4621b;
import p314lg.ActivityCommentListBinding;
import p325m0.MutabilityOwnership;
import p347mm.AccountUtils;
import p347mm.DefaultContentRecyclerViewBehavior;
import p350mp.Timber;
import p394og.C5454a;
import p436q6.C5768b;
import p467rd.subscribers;
import p517td.BehaviorSubject;
import p579vo.Qualifier;
import p593wc.AbstractC6902j;
import p603wm.AbstractC6949c;
import p603wm.Unit;
import p607x0.C7050l;
import p629xm.IteratorsJVM;
import p637y4.Collectors;
import p639y6.C7296l;
import p645yc.AndroidSchedulers;
import p665z6.C7456k;
import p665z6.C7457l;
import p665z6.C7461p;
import p665z6.C7468w;
import p671zc.CompositeDisposable;
import p671zc.Disposable;

/* compiled from: CommentListActivity.kt */
/* renamed from: jp.pxv.android.activity.CommentListActivity */
/* loaded from: classes2.dex */
public final class CommentListActivity extends AbstractActivityC0110k0 {

    /* renamed from: l0 */
    public static final /* synthetic */ int f18317l0;

    /* renamed from: f0 */
    public NestedCommentAdapter f18322f0;

    /* renamed from: g0 */
    public LinearLayoutManager f18323g0;

    /* renamed from: h0 */
    public boolean f18324h0;

    /* renamed from: i0 */
    public int f18325i0;

    /* renamed from: b0 */
    public final AbstractC6949c f18318b0 = C4621b.m3851a(this, C3993a.f18328c);

    /* renamed from: c0 */
    public final AbstractC6949c f18319c0 = Preconditions.m9801Q(new C3999g(this, "WORK"));

    /* renamed from: d0 */
    public final AbstractC6949c f18320d0 = Preconditions.m9802P(1, new C3998f(this, null, null));

    /* renamed from: e0 */
    public final CompositeDisposable f18321e0 = new CompositeDisposable();

    /* renamed from: j0 */
    public final AbstractC6949c f18326j0 = new ViewModelLazy(Reflection.m5499a(CommentInputActionCreator.class), new C4001i(this), new C4000h(this));

    /* renamed from: k0 */
    public final AbstractC6949c f18327k0 = new ViewModelLazy(Reflection.m5499a(CommentInputStore.class), new C4003k(this), new C4002j(this));

    /* compiled from: CommentListActivity.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$b */
    /* loaded from: classes2.dex */
    public static final class C3994b extends Lambda implements AbstractC3446l<Throwable, Unit> {

        /* renamed from: a */
        public static final C3994b f18329a = new C3994b();

        public C3994b() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            Throwable th2 = th;
            MutabilityOwnership.m3745m(th2, "it");
            Timber.f23100a.mo3523f(th2, "Failed to subscribe BehaviorSubject.", new Object[0]);
            return Unit.f29503a;
        }
    }

    /* compiled from: CommentListActivity.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$c */
    /* loaded from: classes2.dex */
    public static final class C3995c extends Lambda implements AbstractC3446l<ContentRecyclerViewState, Unit> {

        /* renamed from: a */
        public final /* synthetic */ DefaultContentRecyclerViewBehavior f18330a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C3995c(DefaultContentRecyclerViewBehavior jVar) {
            super(1);
            this.f18330a = jVar;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(ContentRecyclerViewState contentRecyclerViewState) {
            this.f18330a.mo3534b(contentRecyclerViewState);
            return Unit.f29503a;
        }
    }

    /* compiled from: CommentListActivity.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$d */
    /* loaded from: classes2.dex */
    public static final class C3996d extends Lambda implements AbstractC3446l<Throwable, Unit> {

        /* renamed from: b */
        public final /* synthetic */ int f18332b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C3996d(int i) {
            super(1);
            CommentListActivity.this = r1;
            this.f18332b = i;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            MutabilityOwnership.m3745m(th, "it");
            NestedCommentAdapter v0Var = CommentListActivity.this.f18322f0;
            if (v0Var != null) {
                int t = v0Var.m10330t(this.f18332b);
                if (t != -1) {
                    ((SeeReplies) v0Var.f4930d.get(t)).f14537c = true;
                    v0Var.m10785f(t);
                }
                CommentListActivity commentListActivity = CommentListActivity.this;
                Toast.makeText(commentListActivity, commentListActivity.getString(R.string.error_default_message), 1).show();
                return Unit.f29503a;
            }
            MutabilityOwnership.m3737u("nestedCommentAdapter");
            throw null;
        }
    }

    /* compiled from: CommentListActivity.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$e */
    /* loaded from: classes2.dex */
    public static final class C3997e extends Lambda implements AbstractC3446l<PixivResponse, Unit> {

        /* renamed from: b */
        public final /* synthetic */ int f18334b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C3997e(int i) {
            super(1);
            CommentListActivity.this = r1;
            this.f18334b = i;
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(PixivResponse pixivResponse) {
            PixivResponse pixivResponse2 = pixivResponse;
            MutabilityOwnership.m3745m(pixivResponse2, "response");
            List<PixivComment> list = pixivResponse2.comments;
            MutabilityOwnership.m3746l(list, "response.comments");
            int i = this.f18334b;
            Objects.requireNonNull((NestedCommentMapper) CommentListActivity.this.f18320d0.getValue());
            ArrayList arrayList = new ArrayList(IteratorsJVM.m703K(list, 10));
            for (PixivComment pixivComment : list) {
                arrayList.add(new ChildComment(pixivComment, i));
            }
            NestedCommentAdapter v0Var = CommentListActivity.this.f18322f0;
            if (v0Var != null) {
                int i2 = this.f18334b;
                String str = pixivResponse2.nextUrl;
                int t = v0Var.m10330t(i2);
                if (t != -1) {
                    SeeReplies eVar = (SeeReplies) v0Var.f4930d.get(t);
                    eVar.f14536b = true;
                    eVar.f14538d = str;
                    if (str != null) {
                        eVar.f14537c = true;
                    } else {
                        eVar.f14537c = false;
                    }
                    v0Var.f3606a.m10778d(t, 1, null);
                    ArrayList arrayList2 = new ArrayList();
                    int i3 = t;
                    while (true) {
                        i3++;
                        if (i3 >= v0Var.f4930d.size()) {
                            break;
                        }
                        NestedCommentItem cVar = v0Var.f4930d.get(i3);
                        if (!(cVar instanceof ChildComment)) {
                            break;
                        }
                        ChildComment aVar = (ChildComment) cVar;
                        if (aVar.f14533b != i2) {
                            break;
                        }
                        arrayList2.add(Integer.valueOf(aVar.mo6304a()));
                    }
                    ObjFilter bVar = new ObjFilter(new LazyIterator(arrayList), new C7296l(arrayList2, 10));
                    Collectors.C7282c cVar2 = (Collectors.C7282c) Collectors.m478a();
                    Object obj = cVar2.f30542a.get();
                    while (bVar.hasNext()) {
                        Object next = bVar.next();
                        Objects.requireNonNull((Collectors.C7281b) cVar2.f30543b);
                        ((List) obj).add(next);
                    }
                    Objects.requireNonNull((C5454a) cVar2.f30544c);
                    List list2 = (List) obj;
                    Collections.reverse(list2);
                    int i4 = t + 1;
                    if (i4 <= v0Var.f4930d.size()) {
                        v0Var.f4930d.addAll(i4, list2);
                    } else {
                        i4 = v0Var.f4930d.size();
                        v0Var.f4930d.addAll(list2);
                    }
                    v0Var.f3606a.m10777e(i4, list2.size());
                }
                return Unit.f29503a;
            }
            MutabilityOwnership.m3737u("nestedCommentAdapter");
            throw null;
        }
    }

    /* compiled from: ComponentCallbackExt.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$f */
    /* loaded from: classes2.dex */
    public static final class C3998f extends Lambda implements AbstractC3435a<NestedCommentMapper> {

        /* renamed from: a */
        public final /* synthetic */ ComponentCallbacks f18335a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C3998f(ComponentCallbacks componentCallbacks, Qualifier aVar, AbstractC3435a aVar2) {
            super(0);
            this.f18335a = componentCallbacks;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [java.lang.Object, ef.a] */
        @Override // p189gn.AbstractC3435a
        public final NestedCommentMapper invoke() {
            return C1124a.m10173s(this.f18335a).f24118a.m920a().m621a(Reflection.m5499a(NestedCommentMapper.class), null, null);
        }
    }

    /* compiled from: ActivityExtension.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$g */
    /* loaded from: classes2.dex */
    public static final class C3999g extends Lambda implements AbstractC3435a<PixivWork> {

        /* renamed from: a */
        public final /* synthetic */ Activity f18336a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C3999g(Activity activity, String str) {
            super(0);
            this.f18336a = activity;
        }

        @Override // p189gn.AbstractC3435a
        public final PixivWork invoke() {
            Bundle extras = this.f18336a.getIntent().getExtras();
            if (extras != null) {
                Object obj = extras.get("WORK");
                Objects.requireNonNull(obj, "null cannot be cast to non-null type jp.pxv.android.legacy.model.PixivWork");
                return (PixivWork) obj;
            }
            throw new IllegalArgumentException("Required value was null.".toString());
        }
    }

    /* compiled from: ActivityViewModelLazy.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$h */
    /* loaded from: classes2.dex */
    public static final class C4000h extends Lambda implements AbstractC3435a<ViewModelProvider.AbstractC0728b> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f18337a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4000h(ComponentActivity componentActivity) {
            super(0);
            this.f18337a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelProvider.AbstractC0728b invoke() {
            ViewModelProvider.AbstractC0728b defaultViewModelProviderFactory = this.f18337a.getDefaultViewModelProviderFactory();
            MutabilityOwnership.m3746l(defaultViewModelProviderFactory, "defaultViewModelProviderFactory");
            return defaultViewModelProviderFactory;
        }
    }

    /* compiled from: ActivityViewModelLazy.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$i */
    /* loaded from: classes2.dex */
    public static final class C4001i extends Lambda implements AbstractC3435a<ViewModelStore> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f18338a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4001i(ComponentActivity componentActivity) {
            super(0);
            this.f18338a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelStore invoke() {
            ViewModelStore viewModelStore = this.f18338a.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "viewModelStore");
            return viewModelStore;
        }
    }

    /* compiled from: ActivityViewModelLazy.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$j */
    /* loaded from: classes2.dex */
    public static final class C4002j extends Lambda implements AbstractC3435a<ViewModelProvider.AbstractC0728b> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f18339a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4002j(ComponentActivity componentActivity) {
            super(0);
            this.f18339a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelProvider.AbstractC0728b invoke() {
            ViewModelProvider.AbstractC0728b defaultViewModelProviderFactory = this.f18339a.getDefaultViewModelProviderFactory();
            MutabilityOwnership.m3746l(defaultViewModelProviderFactory, "defaultViewModelProviderFactory");
            return defaultViewModelProviderFactory;
        }
    }

    /* compiled from: ActivityViewModelLazy.kt */
    /* renamed from: jp.pxv.android.activity.CommentListActivity$k */
    /* loaded from: classes2.dex */
    public static final class C4003k extends Lambda implements AbstractC3435a<ViewModelStore> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f18340a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4003k(ComponentActivity componentActivity) {
            super(0);
            this.f18340a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelStore invoke() {
            ViewModelStore viewModelStore = this.f18340a.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "viewModelStore");
            return viewModelStore;
        }
    }

    public CommentListActivity() {
        super(R.layout.activity_comment_list);
    }

    /* JADX WARN: Removed duplicated region for block: B:17:0x0036  */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0046  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x00ac  */
    /* JADX WARN: Removed duplicated region for block: B:43:0x00c4  */
    /* renamed from: e1 */
    /* Code decompiled incorrectly, please refer to instructions dump */
    public static final void m4833e1(p270jp.pxv.android.activity.CommentListActivity r9, p270jp.pxv.android.commonObjects.model.PixivComment r10, java.lang.Integer r11) {
        /*
        // Method dump skipped, instructions count: 235
        */
        throw new UnsupportedOperationException("Method not decompiled: p270jp.pxv.android.activity.CommentListActivity.m4833e1(jp.pxv.android.activity.CommentListActivity, jp.pxv.android.commonObjects.model.PixivComment, java.lang.Integer):void");
    }

    /* renamed from: f1 */
    public final ActivityCommentListBinding m4832f1() {
        return (ActivityCommentListBinding) this.f18318b0.getValue();
    }

    /* renamed from: g1 */
    public final CommentInputActionCreator m4831g1() {
        return (CommentInputActionCreator) this.f18326j0.getValue();
    }

    /* renamed from: h1 */
    public final CommentInputStore m4830h1() {
        return (CommentInputStore) this.f18327k0.getValue();
    }

    /* renamed from: i1 */
    public final PixivWork m4829i1() {
        return (PixivWork) this.f18319c0.getValue();
    }

    /* renamed from: j1 */
    public final void m4828j1(PixivWork pixivWork, SeeReplies eVar) {
        AbstractC6902j<PixivResponse> jVar;
        if (eVar.f14536b) {
            String str = eVar.f14538d;
            if (str == null) {
                Timber.f23100a.mo3523f(new IllegalStateException(), "nextUrl is null", new Object[0]);
                jVar = null;
            } else {
                jVar = PixivRequest.m5813d(str);
            }
        } else if (pixivWork instanceof PixivIllust) {
            jVar = PixivAccountManager.m5511e().m5514b().m989l(new C3361j((long) eVar.f14535a, 0));
        } else if (pixivWork instanceof PixivNovel) {
            jVar = PixivAccountManager.m5511e().m5514b().m989l(new C0149r7((long) eVar.f14535a, 3));
        } else {
            Timber.f23100a.mo3523f(new IllegalStateException(), "invalid work", new Object[0]);
            jVar = null;
        }
        if (jVar != null) {
            int i = eVar.f14535a;
            Disposable g = subscribers.m2589g(jVar.m986o(AndroidSchedulers.m334a()), new C3996d(i), null, new C3997e(i), 2);
            CompositeDisposable aVar = this.f18321e0;
            MutabilityOwnership.m3744n(aVar, "compositeDisposable");
            aVar.mo82c(g);
        }
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, android.app.Activity
    public void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 109 && i2 == -1) {
            boolean z = true;
            if (intent == null || !intent.getBooleanExtra("result_key_should_show_mail_authorization", false)) {
                z = false;
            }
            if (z) {
                AccountUtils.m3550d(this, this.f18321e0);
            }
        }
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, androidx.activity.ComponentActivity, android.app.Activity
    public void onBackPressed() {
        if (MutabilityOwnership.m3749h(m4830h1().f18924l.m11091f(), CommentInputState.OpenContainer.f18904a)) {
            m4831g1().m4634d();
        } else {
            super.onBackPressed();
        }
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        AbstractC6902j jVar;
        super.onCreate(bundle);
        MaterialToolbar materialToolbar = m4832f1().f21455f;
        MutabilityOwnership.m3746l(materialToolbar, "binding.toolBar");
        C0536v1.m11537h(this, materialToolbar, R.string.title_comment);
        PixivAnalytics eVar = this.f18757A;
        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
        eVar.m6524f(AnalyticsScreenName.COMMENT_LIST, null);
        Preconditions.m9798T(m4830h1().f18924l, this, new C0134p(this));
        Preconditions.m9798T(m4830h1().f18920h, this, new p014ae.CommentListActivity(this));
        NestedCommentAdapter v0Var = new NestedCommentAdapter();
        this.f18322f0 = v0Var;
        PixivWork i1 = m4829i1();
        EdgeTreatment.m3909i(i1);
        v0Var.f4931e = i1;
        this.f18325i0 = getIntent().getIntExtra("COMMENT_ID_FOR_AUTO_OPEN_REPLY_LIST", -1);
        ResponseAttacher responseAttacher = new ResponseAttacher(C7468w.f31290g, new C7461p(this, 6), new C5768b(this, 7));
        this.f18323g0 = new LinearLayoutManager(1, false);
        ContentRecyclerView contentRecyclerView = m4832f1().f21452c;
        LinearLayoutManager linearLayoutManager = this.f18323g0;
        if (linearLayoutManager != null) {
            contentRecyclerView.setLayoutManager(linearLayoutManager);
            PixivWork i12 = m4829i1();
            if (i12 instanceof PixivIllust) {
                jVar = PixivAccountManager.m5511e().m5514b().m989l(new C7456k(i12.f19079id, 4));
            } else if (i12 instanceof PixivNovel) {
                jVar = PixivAccountManager.m5511e().m5514b().m989l(new C7456k(i12.f19079id, 5));
            } else {
                Timber.f23100a.mo3525d("Invalid content type", new Object[0]);
                jVar = null;
            }
            C7050l lVar = new C7050l(jVar);
            ContentRecyclerView contentRecyclerView2 = m4832f1().f21452c;
            contentRecyclerView2.f19470J0 = lVar;
            contentRecyclerView2.f19471K0 = responseAttacher;
            contentRecyclerView2.m4509v0();
            DefaultContentRecyclerViewBehavior jVar2 = new DefaultContentRecyclerViewBehavior(m4832f1().f21452c, m4832f1().f21453d, m4832f1().f21454e, false);
            BehaviorSubject<ContentRecyclerViewState> state = m4832f1().f21452c.getState();
            MutabilityOwnership.m3746l(state, "binding.contentRecyclerView.state");
            Disposable g = subscribers.m2589g(state, C3994b.f18329a, null, new C3995c(jVar2), 2);
            CompositeDisposable aVar = this.f18321e0;
            MutabilityOwnership.m3744n(aVar, "compositeDisposable");
            aVar.mo82c(g);
            m4832f1().f21454e.setOnRefreshListener(new C1048a(this, 1));
            m4832f1().f21452c.m4506y0();
            if (bundle == null) {
                m4831g1().m4632f(m4829i1(), null);
            }
            if (!PixivAccountManager.m5511e().f16505k) {
                m4831g1().f18914d.mo2437b(CommentInputAction.C4518c.f20320a);
                m4832f1().f21451b.setOnClickListener(new View$OnClickListenerC0054c(this, 1));
            }
            if (((PixivComment) getIntent().getSerializableExtra("COMMENT_TO_REPLY_TO")) != null && bundle == null) {
                this.f18324h0 = true;
                return;
            }
            return;
        }
        MutabilityOwnership.m3737u("linearLayoutManager");
        throw null;
    }

    @Override // p014ae.AdActivity, p270jp.pxv.android.activity.BaseActivity, p116e.ActivityC2727f, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        this.f18321e0.m80f();
        super.onDestroy();
    }

    @Subscribe
    public final void onEvent(ShowCommentInputEvent showCommentInputEvent) {
        MutabilityOwnership.m3745m(showCommentInputEvent, "event");
        PixivWork work = showCommentInputEvent.getWork();
        MutabilityOwnership.m3746l(work, "event.work");
        AccountUtils.m3552b(this, this.f18321e0, new C7457l(this, work, showCommentInputEvent.getComment(), 1));
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, p014ae.AdActivity, p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onResume() {
        super.onResume();
        if (this.f18324h0) {
            this.f18324h0 = false;
            AccountUtils.m3552b(this, this.f18321e0, new C7457l(this, m4829i1(), (PixivComment) getIntent().getSerializableExtra("COMMENT_TO_REPLY_TO"), 1));
        }
    }

    @Subscribe
    public final void onEvent(RemoveCommentEvent removeCommentEvent) {
        MutabilityOwnership.m3745m(removeCommentEvent, "event");
        FragmentManager K0 = m11131K0();
        MutabilityOwnership.m3746l(K0, "supportFragmentManager");
        PixivComment comment = removeCommentEvent.getComment();
        MutabilityOwnership.m3746l(comment, "event.comment");
        PixivWork work = removeCommentEvent.getWork();
        MutabilityOwnership.m3746l(work, "event.work");
        C1124a.m10194T(this, K0, new RemoveCommentConfirmedEvent(comment, work), new EventNone());
    }

    @Subscribe
    public final void onEvent(ClickSeeRepliesEvent clickSeeRepliesEvent) {
        MutabilityOwnership.m3745m(clickSeeRepliesEvent, "event");
        PixivWork work = clickSeeRepliesEvent.getWork();
        MutabilityOwnership.m3746l(work, "event.work");
        SeeReplies seeReplies = clickSeeRepliesEvent.getSeeReplies();
        MutabilityOwnership.m3746l(seeReplies, "event.seeReplies");
        m4828j1(work, seeReplies);
    }

    @Subscribe
    public final void onEvent(RemoveCommentConfirmedEvent removeCommentConfirmedEvent) {
        MutabilityOwnership.m3745m(removeCommentConfirmedEvent, "event");
        C1124a.m10210D(this, this.f18321e0, removeCommentConfirmedEvent, new C0124n(this, removeCommentConfirmedEvent, 0));
    }
}
